Skip to content

fix(errors): describe the mutation coordination lock truthfully - #314

Draft
munezaclovis wants to merge 2 commits into
mainfrom
agent/fix-coordination-lock-wording
Draft

fix(errors): describe the mutation coordination lock truthfully#314
munezaclovis wants to merge 2 commits into
mainfrom
agent/fix-coordination-lock-wording

Conversation

@munezaclovis

Copy link
Copy Markdown
Contributor

What changed

  • Define the lock precisely as coordination between foreground PV self-update and queued daemon mutations.
  • Keep the legacy ~/.pv/run/update.lock path and existing lock lifetime unchanged.
  • Document that the persistent file is not evidence of contention and that stale unlocked files remain harmless.
  • Document that previously persisted job text is historical and is not rewritten.
  • Replace update-specific typed errors with CoordinationLockHeld across state, CLI, and daemon paths.
  • Update CLI and JSON-visible daemon snapshots to use the same neutral wording.

Why

Both foreground self-update and daemon reconciliation/update work acquire the same OS lock. The previous error always claimed “PV update is already in progress,” even when reconciliation held it, and could be read as saying the persistent file itself caused contention.

The new wording identifies the exact coordination scope and the active OS lock while leaving mutual exclusion behavior untouched.

Review commits

  1. docs(design): define mutation coordination lock scope
  2. fix(errors): use neutral coordination lock wording

Checks

  • cargo fmt --all -- --check
  • cargo clippy --workspace --all-targets --all-features --locked -- -D warnings
  • cargo nextest run -p state (84 passed)
  • cargo nextest run -p cli --test update --test project_open (46 passed)
  • cargo test -p daemon --lib (108 passed)
  • cargo test -p daemon --test daemon_foundation (30 passed)

Closes #308

@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 82bde7a6-d372-4564-89f1-bb7c046bca2a

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codspeed-hq

codspeed-hq Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 7 untouched benchmarks


Comparing agent/fix-coordination-lock-wording (a56bb83) with main (058373c)

Open in CodSpeed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Global reconciliation lock is reported as “PV update is already in progress”

1 participant